<template>
  <div class="role-power-pop">
    <el-tree
      :data="menuData"
      show-checkbox
      node-key="menu_id"
      :props="defaultProps"
      @check="changeTree"
    >
    </el-tree>
    <el-row type="flex" justify="end" class="mar-t20">
      <el-button type="primary" size="small">保存</el-button>
    </el-row>
  </div>
</template>
<script>
import { menuJson } from "@/views/system/menu/menuJson"
export default {
  props: {
    roleId: {
      type: String,
      required: true,
    },
  },
  data() {
    return {
      menuData: menuJson,
      defaultProps: {
        children: "children",
        label: "menu_name",
      },
    }
  },
  mounted() {
    console.log(this.roleId)
  },
  methods: {
    changeTree(checkedNodes, checkedKeys, halfCheckedNodes, halfCheckedKeys) {
      console.log(checkedNodes, checkedKeys, halfCheckedNodes, halfCheckedKeys)
    },
  },
}
</script>
